#include<stdio.h>
typedef struct student
{
	long long id;
	char name[16];
	int score[3];
}stu;
void f1(stu *p)
{
	scanf("%s",p->name);
	for(int i=0;i<3;i++)
	{
		scanf("%d",&(p->score[i]));
	}
	printf("Add success\n");
	return;
}
void f2(stu *p)
{
	p->id=-1;
	printf("Delete success\n");
	return;
}
void f3(stu *p)
{
	for(int i=0;i<3;i++)
	{
		scanf("%d",&(p->score[i]));
	}
	printf("Update success\n");
	return;
}
void f4(stu *p)
{
	float average;
	printf("Student ID:%lld\nName:%s\n",p->id,p->name);
	for(int i=0;i<3;i++)
	{
		average+=p->score[i];
	}
	average/=3;
	printf("Average Score:%.1f\n",average);
	return;
}
int main()
{
	int n,function,bol;
	stu *p;
	stu s[130];
	char wa[1000];
	for(int i=0;i<130;i++)
	s[i].id=0; 
	long long id;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		scanf("%d",&function);
		bol=0;
		switch(function)
		{
			case 1:
			scanf("%lld",&id);
			for(int i=0;i<130;i++)
			{
				if(id==s[i].id)
				{
					gets(wa);	
					printf("Students already exist\n");
					bol=1;
					break;
				}
			}
			if(bol==0)
			{
				for(int i=0;i<130;i++)
				{
					if(s[i].id==0)
					{
						s[i].id=id;
						p=&s[i];
						f1(p);
						break;
					}
				}
			}
			break;
			case 2:
			scanf("%lld",&id);
			for(int i=0;i<130;i++)
			{
				if(id==s[i].id)
				{
					p=&s[i];
					f2(p);
					bol=1;
				}
			}
			if(bol==0)
			printf("Students do not exist\n");
			break;
			case 3:
			scanf("%lld",&id);
			for(int i=0;i<130;i++)
			{
				if(id==s[i].id)
				{
					p=&s[i];
					f3(p);
					bol=1;
				}
			}
			if(bol==0)
			{
				printf("Students do not exist\n");
				gets(wa);	
			}
			break;
			case 4:
			scanf("%lld",&id);
			for(int i=0;i<130;i++)
			{
				if(id==s[i].id)
				{
					p=&s[i];
					f4(p);
					bol=1;
				}
			}
			if(bol==0)
			printf("Students do not exist\n");
			break;
			default:break;
		}
	}
	return 0;
}
